import http from '@/util/request.js'
export default {
    // 获取订单列表
    getOrderList: (data) => {
        return http({
            url: '/api/order/list',
            method: 'get',
            params: data
        })
    },

    // 获取订单分页列表
    getOrderPage: (current, size, data) => {
        return http({
            url: '/api/order/page',
            method: 'get',
            params: {
                current: current,
                size: size,
                ...data
            }
        })
    },

    // 根据ID获取订单
    getOrderById: (id) => {
        return http({
            url: `/api/order/id/${id}`,
            method: 'get'
        })
    },

    // 添加订单
    addOrder: (data) => {
        return http({
            url: '/api/order/add',
            method: 'post',
            data
        })
    },

    // 更新订单
    updateOrder: (data) => {
        return http({
            url: '/api/order/update',
            method: 'put',
            data
        })
    },

    // 删除订单
    deleteOrder: (id) => {
        return http({
            url: `/api/order/delete/${id}`,
            method: 'delete'
        })
    }
}
